//
//  PEDeviceStatusItemCell.m
//  RuiHeAppApp
//
//  Created by Yan Chen on 2023/12/11.
//

#import "RHDeviceStatusItemCell.h"
#import "RHDeviceStatusView.h"
@interface RHDeviceStatusItemCell()

@property (nonatomic, strong) RHDeviceStatusView *statusView;
@end
@implementation RHDeviceStatusItemCell
-(instancetype)initWithFrame:(CGRect)frame
{
    if(self = [super initWithFrame:frame]){
        [self setupUI];
    }
    return self;
}

- (void)setDic:(NSDictionary *)dic
{
    _dic = dic;
    self.statusView.dic = dic;
}

-(void)setupUI
{
    self.backgroundColor = UIColor.clearColor;
    self.contentView.backgroundColor = UIColor.clearColor;
    
    UIView *bgView = kView;
    bgView.backgroundColor = UIColor.whiteColor;
    bgView.layer.cornerRadius = 8;
    bgView.layer.masksToBounds = YES;
    [self.contentView addSubview:bgView];
    [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.insets(UIEdgeInsetsMake(0, 15, 0, 15));
        make.height.offset(kUI_WINDOW_W*0.5);
    }];
   
    _statusView = [[RHDeviceStatusView alloc]init];
    _statusView.backgroundColor = [UIColor whiteColor];
    _statusView.angleArr = @[@(270),@(180),@(100),@(240)];
    [bgView addSubview:_statusView];
    [_statusView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.insets(UIEdgeInsetsZero);
    }];
    
}
@end
